import request from '@/utils/request'


export const login = (data) => {
  return request({
    url: '/users/login',
    method: 'post',
    data
  })
}

export const Register = (data) => {
  return request({
    url: '/users/register',
    method: 'put',
    data
  })
}

export const getInfo = (data) => {
  return request({
    url: '/users/info',
    method: 'post',
    data
  })
}
export const changeInfo = (data) => {
  return request({
    url: '/users/updateinfo',
    method: 'post',
    data
  })
}
export const upload = (data) => {
  return request({
    url: '/upload/upload',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
export const getCode = (data) => {
  return request({
    url: '/users/test',
    method: 'get',
  })
}